<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <title>新增营销活动</title>
    <meta name="viewport"
     content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui-slide.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui-pull-refresh.css" />
    <link rel="stylesheet" type="text/css" href="../script/vant/index.css" />
    <link rel="stylesheet" type="text/css" href="../css/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="css/common.css" />
    <link rel="stylesheet" type="text/css" href="css/editstyle.css" />
    <link rel="stylesheet" type="text/css" href="css/public.css" />
    <link rel="stylesheet" type="text/css" href="css/activity.css" />
    <style>
        .van-popup{
            width: 90%;
            border-radius: 16px;
            min-height: 300px;
        }
        .project_main{
            width: 90%;
            margin: 20px auto;
        }
        .pro_title{
            width: 100%;
            height: 2rem;
            line-height: 2rem;
            text-align: center;
            border-bottom: solid 0.5px #f3f3f3;
        }
        .centerbox{
            width: 90%;
            left: 5%;
            min-height: 300px;
            max-height: 530px;
            position: absolute;
            top:10%;
            background: #fff;
            padding-top: 10px;
            border-radius: 10px;
            box-shadow: 0px 0px 6px 0px rgb(0 0 0 / 20%);
            z-index: 99999;

        }
        .choose_room_content{
            margin: 28px 8px 20px 8px;
            position: absolute;
            top: 3rem;
            bottom: 20px;
            left: 10px;
            right: 10px;
            overflow: scroll;
            z-index: 10001;
            /* background: #ff0; */
        }
        .choose_room_item{
            /* background: #f00; */
            position:relative;
            padding-left: 15px;
            padding-right: 15px;
            margin-bottom: 0.25rem;
        }
        .choose_room_item label{
            line-height: 2.2rem;
            color: #333;
        }
        .choose_room_item i{
            float: right;
            line-height: 2.2rem;
            color: #289fff;
            font-size: 1rem;
        }
        .aui-radio, .aui-checkbox{
            width: 0.8rem;
            height: 0.8rem;
            float: right;
            top:8px;
        }
        .selected{
            background-color: #f8f8f8;
            border-radius: 5px;
        }
    </style>

</head>

<body>
    <!-- v-cloak -->
    <div id="app" v-cloak>
        <div v-if="show_pro" class="maskbg" v-on:click="closebox()">
        </div>
        <!-- 点击编辑商品 -->
        <div  v-if="show_pro" class="centerbox">
            <div class="small_wintitle font8 font-weight" style="font-size: 1rem;">活动商品信息录入</div>
            <div class="sm_winbox">
                <div class="dcwj_con2">
                    <div class="dcwj_list ">
                        <div class="fmly_lft color9 fl font7" style="width: 28%;">商品名称</div>
                        <div class="dcwj_left fr">
                            <label class="noedit font7">{{editmsg.Name}}</label>
                            <!-- <span>{{cen_winobj.producttitle}}</span> -->
                        </div>
                    </div>
                    <div class="dcwj_list ">
                        <div class="fmly_lft color9 fl font7" style="width: 28%;">销售价</div>
                        <div class="dcwj_left fr">
                            <label class="noedit">￥{{editmsg.SalePrice}}</label>
                        </div>
                    </div>
                    <div v-if="Type!=1" class="dcwj_list ">
                        <div class="fmly_lft color9 fl font7" style="width: 30%;">活动单价<i
                                class="icon iconfont icon-bitianxiang- redcolor bitian"></i></div>
                        <div class="dcwj_left fr">
                            <input type="number" placeholder="0" class="fr" v-model="editmsg.ActivityPrice" style=" width: 50%; padding-right: 10px; border:solid 0.5px #ddd">
                        </div>
                    </div>
                    <div class="dcwj_list">
                        <div class="fmly_lft color9 fl font7" style="width: 28%;">限购数量</div>
                        <div class="dcwj_left fr">
                            <input type="number" placeholder="0" class="fr" v-model="editmsg.LimitCount" style=" width: 50%; padding-right: 10px; border:solid 0.5px #ddd">
                        </div>
                    </div>
                </div>

            </div>
            <div class="win_pagebtn">
                <div class="linebuttom sortwidth fl" v-on:click="closebox()">取消</div>
                <div class="buttom sortwidth fr" v-on:click="save_editpro()">保存</div>
            </div>
        </div>
        <van-popup v-model="show_project" >
            <div class="project_main">
                <div class="pro_title">选择所属项目</div>
                <div class="choose_room_content">
                    <div v-on:click="doSelectRoom(item)"  class="choose_room_item"  v-for="item in ProjectList" v-bind:class="{'selected':ProjectID==item.ID}" >
                        <label>{{item.Name}}</label><i v-if="ProjectID==item.ID" class="icon iconfont icon-0-58"></i>
                    </div>
                </div>
            </div>
        </van-popup>
        <van-calendar v-model="showTime" :show-confirm="false"  type="range" @confirm="onConfirm" style="width: 100%;" ></van-calendar>
        <section class="bodymain">
            <!-- 销售信息 -->
            <div class="order_detail mt10">
                <div class="dcwj_con2">
                    <div class="dcwj_list bor_bottom">
                        <div class="fmly_lft color9 fl">活动名称<i
                                class="icon iconfont icon-bitianxiang- redcolor bitian"></i></div>
                        <div class="dcwj_left fr">
                            <input type="text" placeholder="请输入活动名称" v-model="Name">
                        </div>
                    </div>
                    <div class="dcwj_list bor_bottom">
                        <div class="fmly_lft color9 fl">所属项目<i
                                class="icon iconfont icon-bitianxiang- redcolor bitian"></i></div>
                        <div class="dcwj_left fr" v-on:click="choose_project()">
                            <input class="fl" type="text" placeholder="请选择" v-model="ProjectName" style="width: 90%;" readonly unselectable="on">
                            <i class="icon iconfont icon-gengduo fr"></i>
                        </div>
                    </div>
                    <div class="dcwj_list bor_bottom">
                        <div class="fmly_lft color9 fl">活动类型<i
                                class="icon iconfont icon-bitianxiang- redcolor bitian"></i></div>
                        <div class="dcwj_left fr">
                            <label class="label-radio">
                                <input class="aui-radio" v-on:click="do_select_type(1)" v-bind:checked="Type==1"
                                    style="margin-right: 10px; position: relative; top:5px; width: 1rem; height: 1rem; border-radius: 20px;"
                                    type="radio" name="PlanType">打折
                            </label>
                            <label class="label-radio">
                                <input class="aui-radio" v-on:click="do_select_type(2)" v-bind:checked="Type==2"
                                    style="margin-right: 10px; width: 1rem; position: relative; top:5px; height: 1rem; border-radius: 20px;"
                                    type="radio" name="PlanType">降价
                            </label>
                        </div>
                    </div>
                    <div v-if="Type==1" class="dcwj_list bor_bottom">
                        <div class="fmly_lft color9 fl">折扣<i
                                class="icon iconfont icon-bitianxiang- redcolor bitian"></i></div>
                        <div class="dcwj_left fr">
                            <input type="number" placeholder="只能输入0.10-1.00 的折扣" v-model="Discount">
                        </div>
                    </div>
                    <div class="dcwj_list">
                        <div class="fmly_lft color9 fl">有效期<i
                                class="icon iconfont icon-bitianxiang- redcolor bitian"></i></div>
                        <div class="dcwj_left fr" v-on:click="choose_time()">
                            <input class="fl" type="text" placeholder="请选择" v-model="youxiaoTime" style="width: 90%;" readonly unselectable="on">
                            <i class="icon iconfont icon-gengduo fr"></i>
                        </div>
                    </div>
                </div>
            </div>
            <div class="order_detail mt15">
                <div class="pro_choose font7 color9">已选择 {{list.length}} 种商品
                    <i class="icon iconfont icon-xinzeng fr" v-on:click="add_product()"></i>
                </div>
                <div class="order_product">
                    <ul class="aui-list aui-media-list" style="background-size:100% 0px; border: none;">
                        <li class="aui-list-item" v-for="item in list" style="border: none; background-size:100% 0px; position: relative;">
                            <div class="aui-media-list-item-inner btn_line">
                                <div class="aui-list-item-media">
                                    <img :src="item.CoverImage">
                                </div>
                                <div class="aui-list-item-inner">
                                    <div class="pro-list-item-title aui-ellipsis-2">
                                        {{item.Name}}
                                    </div>
                                    <div class="pro_type">
                                        <div class="pro_type_item fl aui-ellipsis-1">型号名称：{{item.TypeTitle}}</div>
                                        <div class="pro_type_itemrgt  fr aui-ellipsis-1">销售价：￥{{item.SalePrice}}</div>
                                        <div v-if="item.LimitCount!=undefined" class="pro_type_item fl aui-ellipsis-1">限购数量：{{item.LimitCount}}</div>
                                        <div v-if="Type!=1" class="pro_type_itemrgt  fr aui-ellipsis-1">活动价：<span
                                                class="font75 font-weight" style="color: #333;">￥{{item.ActivityPrice}}</span></div>
                                    </div>
                                </div>
                            </div>
                            <div class="order_pro_fk">
                                <div class="or_pro_rgt">
                                    <div class="or_pro_fk" v-on:click="update_pro(item)">编辑</div>
                                    <div class="or_pro_fk" v-on:click="delete_pro(item.ID)">移除</div>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </section>
        <div class="pagebtn">
            <div class="buttom longwidth" v-on:click="do_saveProduct()">保存</div>
        </div>
    </div>
</body>
<script type="text/javascript " src="../script/api.js "></script>
<script type="text/javascript " src="../script/vant/vue.js"></script>
<script type="text/javascript " src="../script/vant/vant.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/aui-actionsheet.js"></script>
<script type="text/javascript" src="../script/aui-slide.js"></script>
<script type="text/javascript" src="../script/aui-pull-refresh.js"></script>
<script type="text/javascript" src="../script/mui/mui.min.js"></script>
<script type="text/javascript" src="../script/mui/mui.picker.min.js"></script>
<script type="text/javascript" src="../script/mui/mui.poppicker.js"></script>
<script type="text/javascript" src="../script/aui-scroll.js"></script>
<script type="text/javascript" src="../script/aui-toast.js"></script>
<script type="text/javascript " src="js/activity_add.js"></script>



</html>